/******************************

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
//for setw, precision()
#include <iomanip>
using namespace std;

int giaiBacHai(float a, float b, float c, float &x1, float &x2)
{
	float d = b*b - 4*a*c;
	if(d>0)
	{
		x1 = (-b+sqrt(d))/(2*a);
		x2 = (-b-sqrt(d))/(2*a);
		return 1;
	}
	if(d==0){
		x1 = -b/(2*a);
		return 0;
	}
	return -1;
}

void main(){
	float a, b, c, x1, x2;
	while (true)
	{
		cout << "\nNhap a: ";
		cin >> a;
		cout << "Nhap b: ";
		cin >> b;
		cout << "Nhap c: ";
		cin >> c;
		int r = giaiBacHai(a,b,c,x1,x2);
		cout<<setiosflags(ios::showpoint)<<setprecision(2);
		//setiosflags(ios::showpoint);
		setprecision(2);
		switch (r)
		{
		case 1:

			cout << "Pt co 2 nghiem pb x1 = " << x1 << " va x2 = " << x2;
			break;
		case 0:
			cout<<"Pt nghiem kep x = "<<x1;
			break;
		default:
			cout <<"Pt vo nghiem";
			break;
		}
	}

	getch();
}

/**********************************/